package com.leco.demo.spring.beans;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author greg
 * @version 2022/10/21
 **/
public class Bean1 {
    private Bean2 bean2;

    @Autowired
    public void setBean2(Bean2 bean2) {
        System.out.println("@Autowire解析执行了");
        this.bean2 = bean2;
    }

    @Override
    public String toString() {
        return "Bean1{" +
                "bean2=" + bean2 +
                '}';
    }
}
